home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
sw_41.zip
/
SW41DEMO.BAT
< prev
Wrap
DOS Batch File
|
1991-12-01
|
7KB
|
253 lines
@ECHO OFF
rem A pre-SW screen just for effect
rem make sure the screen is default white on black
rem reset border
sw /o
rem save existing prompt
set sav=%prompt%
rem make sure there was room in environment
if "%sav%"=="" goto skip
set prompt=$e[0m$p$g
@echo on
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo Are Your Batch Files Dull?
echo.
echo Lifeless?
echo.
echo Boring?
echo.
echo SW.EXE is the answer!
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
set prompt=%sav%
set sav=
:skip
rem skip over screen definitions
rem Put screen definitions at the beginning of the file for fastest execution
goto begin
rem Screen definition with default label
rem Windows are drawn in the order defined. Pause, Query and User Input will
rem occur as they are encountered. SW will return only the last Query result.
:Display
_window /kcya┼ /r2 /s /bred /w /0 /z
SW.EXE - Expanded Text Handling!
/tWHI+ Multiple Windows!
/m v 4.1
_window /r10 /s /bwhi /gblu /l1 /fred /0
/tBLU Optional Command Line Syntax:
SW @filename [label]
_window /r16 /s /bwhi /gblu /l1 /fred /0
/tBLU SW 4.x ADDITIONAL FEATURES
/tred ───────────────────────────────────────────────────
/jl - Define the entire screen with multiple windows
using external text files.
_window /r25 /l0 /0 /p100- /d
- Press any key for more -
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
- Text handling can be expanded to 20 single-spaced
lines per window.
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
- Using labels, more than one definition can be
included in the same file.
_window /r19 /bwhi /gblu /l0 /jl /0
- The screen definition can be included inside the
calling batch file!
_window /r25 /l0 /0 /p200- /d
- Press any key to continue -
:end_display
rem screen definition showing a menu with user defined label
:menu
_window /kmag╬ /r3 /s /bred /w /0 /z
SW.EXE - New Sounds!
/m " v 4.1 "
_window /eRED /r12 /s /l1 /w
/mc ┤ Play a Sound ├
~Low Tone ~Mid Tone ~High Tone
Bweep ~1 Bweep ~2 ~Bomb
~Siren ~Phasor ~Tweeter
~E~S~C
:end_menu
rem screen definition showing a menu with another user defined label
:4.1
_window /kwhi░▒▓ /kBLA /r3 /s /bred /w /0 /o /z
SW.EXE - No More Echoes!
/m v 4.1
_window /tRED /r11 /fWHI /s
They can also be placed anywhere on the screen they'll fit!
_window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
Upper Left
_window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
Upper Right
_window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
Lower Right
_window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
Lower Left
_window /r19 /fWHI /tYEL+ /b4 /l5
(c) 1991 Warren Small
_window /r25 /l0 /0 /p100-
- Pausing 10 seconds -
_window /r25 /l0 /0 /p2
- or less! -
:end_4.1
rem labels for Alert sounds demos near the beginning of file
rem for faster execution
:beep1
sw /a1
goto BeepDemo
:beep2
sw /a2
goto BeepDemo
:beep3
sw /a3
goto BeepDemo
:beep4
sw /a4
goto BeepDemo
:beep5
sw /a5
goto BeepDemo
:beep6
sw /a6
goto BeepDemo
:beep7
sw /a7
goto BeepDemo
:beep8
sw /a8
goto BeepDemo
:beep9
sw /a9
:beepdemo
sw /q`~lmh12bspt
if errorlevel 9 goto beep9
if errorlevel 8 goto beep8
if errorlevel 7 goto beep7
if errorlevel 6 goto beep6
if errorlevel 5 goto beep5
if errorlevel 4 goto beep4
if errorlevel 3 goto beep3
if errorlevel 2 goto beep2
if errorlevel 1 goto beep1
if errorlevel 0 goto DI
rem Command line examples, positioning, colors, shadows, pause, Wide edge
rem Color numbers are used to shorten the line
rem Command line cannot exceed 128 characters
:begin
sw /kwhi /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.1 " /o /z
sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
sw /r18 /l3 "With the command form" /t11 "Display up to 5 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
sw /r25 /l0 /0 "- Press any key to continue -" /p100-
rem More command line examples, justify, borders
sw /kcya┼──── /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.1 " /z
sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
sw /bwhi /r19 /gyel /l0 /0 /c4 /jl "Justify" "Text" "Left"
sw /bwhi /r19 /gyel /l0 /0 /c66 /jr "Justify" "Text" "Right"
sw /r25 /l0 /0 "- Press any key to continue -" /p100-
set colr=bla
rem Make sure there was room in the environment
if "%colr=="" goto next
rem Another command line example, Query with default, Border Message, Draw
sw /kblu /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.1 " /z
rem The following line is longer than 128 characters BUT it works because
rem when the line is processed by DOS, the %colr% variable is replaced by
rem the color value making the command line 3 characters shorter.
:colors
sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown ~Cyan ~White ~Green" "Press ~E~S~C to go on..." /q`~bcwg /2 /l5 /d
if errorlevel 4 set colr=gre
if errorlevel 4 goto colors
if errorlevel 3 set colr=whi
if errorlevel 3 goto colors
if errorlevel 2 set colr=cya
if errorlevel 2 goto colors
if errorlevel 1 set colr=yel
if errorlevel 1 goto colors
:next
set colr=
rem Display screen definition with default label
sw @sw41demo.bat
rem Display screen definition in external file
sw @sw-41.new
rem Display screen definition with label 'menu'
sw @sw41demo.bat menu
rem Query is handled separately beacause I wanted to return to the menu
rem after processing the response without redoing the screen.
rem I also placed it nearer the top of the file to speed it up.
goto beepdemo
rem create screen definition on the fly to demo DI.EXE
:DI
sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
echo rem This file was created by SW41DEMO.BAT > di.hlp
echo rem If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
echo rem "SW @DI.HLP" >> di.hlp
echo.>> di.hlp
echo :Display >> di.hlp
echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
echo SW.EXE - Now with DI!>> di.hlp
echo /mc v 4.1 >> di.hlp
echo _window /jl /s /0 /r9 >> di.hlp
echo /mc Disk Information >> di.hlp
echo.>> di.hlp
di >> di.hlp
echo. >> di.hlp
echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
echo - Press any key to continue - >> di.hlp
echo :End_Display >> di.hlp
sw @di.hlp
rem Display screen definition with label '4.1'
:final
sw @sw41demo.bat 4.1
rem display help screen
:help
sw